<?php

/**
 * OperadoresEgresos form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class OperadoresEgresosForm extends BaseOperadoresEgresosForm
{
  public function configure()
  {
      
     unset(
          $this['created_at'],
          $this['updated_at'],
          $this['nota'],
          $this['nota_operador'],
          $this['is_franquicia'],
          $this['cancelacion_razon_id'],
          $this['monto_deposito'],
          $this['monto_deposito'],
          $this['is_vista']
      );
     
     $this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
     $this->widgetSchema['cantidad'] =  new sfWidgetFormInputText(array(),array('value' => 1));
     $this->widgetSchema['fecha'] = new sfWidgetFormInput(array(), array('size' => 15, 'id' => 'fechaDashboard', 'readonly'=>'readonly'));
     
     $this->widgetSchema['camioneta_id'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['operadores_prestamos_id'] = new sfWidgetFormInputHidden();
     $this->widgetSchema['monto_pago'] = new sfWidgetFormInputHidden();
     
     $this->widgetSchema['operador_id'] = new sfWidgetFormDoctrineChoice(array(
         'multiple' => false, 
         'model' => 'sfGuardUser',
         'query' => Doctrine_Query::create()->select('sf.id,sf.username')
                                    ->from('sfGuardUser sf')
                                    ->leftJoin('sf.sfGuardUserPermission s')
                                    ->where('sf.is_active = 1')
                                    ->addWhere('sf.empresa_id=?', sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id'))
                                    ->addWhere('s.permission_id=7')
                                    ->addWhere('s.permission_id=7')
                                    ->orderBy('sf.username asc'),
         'expanded' => false));
       
  }
}
